package com.qf.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.entity.ResultHcs;
import com.qf.mapper.ProgrammerMapper;
import com.qf.pojo.Programmer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/second")
public class ProgrammerController {

    @Autowired
    private ProgrammerMapper programmerMapper;

    @PostMapping
    public ResultHcs test2(){
        List<Programmer> programmers = programmerMapper.selectList(null);
//        LambdaQueryWrapper<Programmer> qw = new LambdaQueryWrapper<>();
//        qw.eq(Programmer::getId,1);
//        Programmer programmer = programmerMapper.selectOne(qw);
        ResultHcs resultHcs =ResultHcs.success(programmers);
        return resultHcs;
    }
}
